(1) Field of the Invention
The present invention relates to a packet data sending apparatus, and more particularly to a packet data sending apparatus capable of sending a plurality of packets at each packet sending timing and a packet data sending apparatus capable of sending packet data at any of a plurality of existing data transmission rates.
(2) Description of the Related Art
With the widespread popularity of the Internet in recent years, there has been a growing concern about services to transmit audio and video data through networks. In order to perform such services, it is necessary to transmit packets at a constant data transmission rate. ATM (Asynchronous Transfer Mode) networks incorporate a hardware arrangement for ensuring a constant data transmission rate. However, any arrangement for attaining a constant data transmission rate is not incorporated in LANs (Local Area Networks), typically the Ethernet that is currently in most widespread use.
The principles of the present invention serve to realize the transmission of packets at a constant data transmission rate in a network which does not incorporate such an arrangement for attaining a constant data transmission rate.
Heretofore, the simplest process of attaining a constant data transmission rate is to send packets, each containing a constant amount of data, at constant time intervals. For example, if a desired data transmission rate is 1 Mbps and one packet contains 1 Kb of data, then 1,000 packets are transmitted per second, i.e., one packet is transmitted per millisecond.
For transmitting packets at a data transmission rate of 1 Mbps under software control, it is programmed to start a task for transmitting a packet at an interval of 1 ms, and one packet containing 1 Kb of data is transmitted each time the task is started. In this manner, the desired data transmission rate is attained. The desired data transmission rate can also be attained in a similar manner for transmitting packets based on a hardware arrangement.
However, the conventional processes cannot expect data transmission rates to be accurate. Specifically, the multitasking principles for simultaneously executing a plurality of tasks with a single CPU are applied to ordinary small-size computers. In the multitasking operation, different tasks are successively processed in divided unit times. Since a next task is started after a preceding task is finished, the time to start the next task depends on the time to finish the preceding task, and may not necessarily be synchronous with the control timing. The range of interrupts whose execution should be given priority is narrowed. Therefore, even if tasks for transmitting packets are set so as to be started at respective constant time intervals, the tasks are actually started at time intervals different from the constant time intervals, and hence no accurate data transmission rate can be expected. For example, if the actual time intervals at which the packet data transmission tasks are started deviate from the constant time intervals by 1%, then the attained data transmission rate also deviates from the desired data transmission rate by 1%.
Thus, an inaccuracy of the time intervals at which the packet data transmission tasks are started directly results in an inaccuracy of the data transmission rate. Usually, reception sides have a buffer for absorbing a variation of the data transmission rate that occurs in a short period of time such as few minutes. However, the buffer cannot absorbing data transmission rate variations if the data is video data which is transmitted over a long period of time.
Time intervals at which tasks are started are determined by a certain minimum unit period, and can only be changed to integral multiples of the minimum unit period. Consequently, the data transmission rate can only take discrete values, and hence cannot be adjusted by smaller values. This also holds true for the hardware-implemented control of data transmission rates.
It is an object of the present invention to provide a packet data sending apparatus which is capable of accurately controlling a data transmission rate at a constant value and continuously changing a data transmission rate.
To achieve the above object, there is provided a packet data sending apparatus for sending a plurality of packets at each packet sending timing. The packet data sending apparatus has sent data amount storage means for storing an amount of packet data sent from a preset time to a preceding packet sending timing, calculating means for adding a plurality of amounts of packet data which may possibly be sent at a present packet sending timing, to the amount of packet data stored in the sent data amount storage means thereby to obtain a plurality of total amounts of packet data, and dividing the total amounts of packet data by a time period from the preset time to the present packet sending timing thereby to calculate a plurality of data transmission rates, selecting means for selecting a data transmission rate closest to a desired data transmission rate from the data transmission rates calculated by the calculating means, and packet sending means for sending a number of packets corresponding to the amount of packet data commensurate with the data transmission rate selected by the selecting means.
The above and other objects, features, and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate preferred embodiments of the present invention by way of example.